<template>
	<view>
		<view v-if="type === '医院'">
			<DoctorIndex v-if="current === 0"></DoctorIndex>
			<DoctorOrder v-if="current === 1"></DoctorOrder>
			<DoctorMine v-if="current === 2"></DoctorMine>
		</view>
		<u-tabbar fixed
			@change="ontabChange"
			inactiveColor="rgba(35,35,35,0.5)"
			activeColor="#2EB0D9"
			:value="current">
			<u-tabbar-item
				v-for="(item,index) in tabs"
				:text="item.text">
						<image
							class="u-page__item__slot-icon"
							slot="active-icon"
							:src="item.activeIcon"
						></image>
						<image
							class="u-page__item__slot-icon"
							slot="inactive-icon"
							:src="item.inactiveIcon"
						></image>
				</u-tabbar-item>
		</u-tabbar>
	</view>
</template>

<script>
	import DoctorIndex from '../index/index.vue'
	import DoctorOrder from '../doctorOrder/doctorOrder.vue'
	import DoctorMine from '../doctorMine/doctorMine.vue'
	export default {
		components:{
			DoctorIndex,
			DoctorOrder,
			DoctorMine
		},
		data() {
			return {
				tabs:[],
				current:0,
				type:'医院'
			}
		},
		onLoad() {
			this.init()
		},
		methods: {
			init(){
				this.tabs = [
					{
						text:'首页',
						activeIcon:'/static/tab_home2.png',
						inactiveIcon:'/static/tab_home1.png'
					},
					{
						text:'订单',
						activeIcon:'/static/tab_order2.png',
						inactiveIcon:'/static/tab_order1.png'
					},
					{
						text:'首页',
						activeIcon:'/static/tab_mine2.png',
						inactiveIcon:'/static/tab_mine1.png'
					},
				]
			},
			ontabChange(e){
				this.current = e
			}
		}
	}
</script>

<style lang="scss" scoped>
.u-page__item__slot-icon{
	width: 40rpx;
	height: 40rpx;
}
</style>
